<?php
/**
 * Created by PhpStorm.
 * User: xiaxiang
 * Date: 2019/6/11
 * Time: 19:10
 */

namespace app\common\validate;


use think\Validate;

class User extends Validate
{
    protected $rule = [
        'account'  => 'require|unique:user',
        'passwd'   => 'require|min:6',
        'repasswd' => 'confirm:passwd',
        'email'    => 'require|email|unique:user',
        'code|验证码' => 'require|captcha'
    ];

    protected $message = [
        "account.require"  => "账号不能为空",
        "account.unique"   => "账号已经被注册",
        "passwd.require"   => "密码不能为空",
        "passwd.min"       => "密码不能小于6位",
        "repasswd.confirm" => "确认密码输入不正确",
        "email.require"    => "邮箱不能为空",
        "email.email"      => "邮箱格式不正确",
        "email.unique"     => "邮箱已经被使用了",
        "code|require"     => "验证码不能为空",
        "code|captcha"     => "验证码输入不正确"
    ];
}